﻿namespace Web7.Ioc
{
    /// <summary>
    /// 管理依赖注入实例的区域
    /// </summary>
    /// <typeparam name="T">将要被注入的类型</typeparam>
    public interface IScopeManager<T>
    {
        /// <summary>
        /// 返回共享单例
        /// </summary>
        /// <returns>注册组件者进一步配置</returns>
        IDependencyRegistrar<T> Singleton();
        /// <summary>
        /// 返回指定区域生命周期的实例
        /// </summary>
        /// <param name="lifetimeName">名称</param>
        /// <returns>注册组件者进一步配置</returns>
        IDependencyRegistrar<T> ForLifetime(string lifetimeName);
        /// <summary>
        /// 每次获取新的实例
        /// </summary>
        /// <returns>注册组件者进一步配置</returns>
        IDependencyRegistrar<T> NewInstanceEachTime();
        /// <summary>
        /// httpRequest级别
        /// </summary>
        /// <returns>注册组件者进一步配置</returns>
        IDependencyRegistrar<T> HttpRequest();
    }
}
